<?php

class UploadsComponent extends Object{
	
	function validar($arquivo){
		if ((isset($arquivo['error']) && $arquivo['error'] == 0) ||
		(!empty( $arquivo['tmp_name']) && $arquivo['tmp_name'] != 'none')) {
			return is_uploaded_file($arquivo['tmp_name']);
		}
		return false;
	}
	
	function armazenar($arquivo){
		$dest_dir = ROOT.DS."secsap".DS."webroot".DS."files".DS;
		echo $dest_dir.$arquivo['name'];
		if(move_uploaded_file($arquivo['tmp_name'], $dest_dir.$arquivo['name'])){
			return true;
		}
		else return false;
	}
	
}